package org.finesys.auth.api.token.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.finesys.common.core.module.R;
import org.finesys.common.feign.annotation.NoToken;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

public interface AuthTokenService {

    /**
     * 刪除token
     */
    @NoToken
    @RequestMapping(value = "/token/remove")
    R<Boolean> removeToken(@RequestParam("token") String token);

    /**
     * 分页查询token
     */
    @NoToken
    @PostMapping(value = "/token/page")
    R<Page<?>> tokenPage(@RequestBody Map<String, Object> params);

    /**
     * 根据token获取用户信息
     */
    @NoToken
    @RequestMapping(value = "/token/getUserByToken")
    R<Map<String, Object>> getUserByToken(@RequestParam("token") String token);


    /**
     * 校验token
     */
    @NoToken
    @RequestMapping("/token/validToken")
    public R<Boolean> validToken(@RequestParam("token") String token);
}
